package android.slc.mp.po;

import androidx.collection.ArrayMap;

/**
 * Created by slc
 */
public class SelectEvent extends ArrayMap<Object, Object> {
    public static final int EVENT_SELECT_COUNT = 1;//通知有选择事件
    public static final int EVENT_CHECK = 2;//通知勾选/取消 某个媒体文件
    public static final int EVENT_OVER_FLOW = 3;//通知选择溢出事件
    public static final int EVENT_NO_ALLOW_MUDDY_MEDIA_TYPE = 4;//通知某类型不允许混合选择
    public static final int EVENT_NO_ALLOW_MULTIPLE_MEDIA_TYPE = 5;//通知不允许多种类型混合选择
    public static final int EVENT_REMOVE_ALL = 6;//通知移除了所有
    public static final int EVENT_ADD_ALL = 6;//通知添加了所有
    @Deprecated //使用监听器的getListenerMediaType方法
    public static final int EVENT_LISTENER_MEDIA_TYPE = 7;//检查监听器所属的媒体文件类型

    public static final String PARAMETER_SELECT_ITEM_COUNT = "selectItemCount";//选择的个数
    public static final String PARAMETER_IS_MULTIPLE_SELECTION = "isMultipleSelection";//是否支持多选
    public static final String PARAMETER_ITEM = "item";//媒体的item

    public static final String PARAMETER_IS_MULTIPLE_MEDIA_TYPE = "isMultipleMediaType";//允许多种类型同时选择
    public static final String PARAMETER_MEDIA_TYPE_MAX_COUNT = "mediaTypeMaxCount";//单个媒体类型可选最大个数
    public static final String PARAMETER_MEDIA_TYPE_SELECT_ITEM_COUNT = "mediaTypeSelectItemCount";//单个媒体类型当前选择的个数

    public <V> V getAuto(Object key) {
        return (V) super.get(key);
    }

    public <K> K keyAtAuto(int index) {
        return (K) super.keyAt(index);
    }

    public <V> V valueAtAuto(int index) {
        return (V) super.valueAt(index);
    }

    public SelectEvent putOfChained(Object key, Object value) {
        super.put(key, value);
        return this;
    }
}
